var app = getApp()
Page({

    /**
     * 页面的初始数据
     */
    data: {
        name: "检测列表",
        currentTab: 0,
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function(options) {
        var that = this;
        that.setData({
                marginTop: app.globalData.statusBarHeight + 'px',
                navTo: app.globalData.navHeight + 'px'
            })
            // wx.getSystemInfo({
            //   success: function (res) {
            //     that.setData({
            //       winWidth: res.windowWidth, winHeight: res.windowHeight
            //     });
            //   }
            // });


    },
    goToMine() {
        wx.switchTab({
            url: '../mine/mine'
        });
    },
    gotodetails(e) {
        let that = this
        let name = e.currentTarget.dataset.name
        wx.navigateTo({
            url: `tabledetail/tabledetail?name=${name}`
        });
    },

    gototablelist(e) {
        let that = this
        let name = e.currentTarget.dataset.name
        wx.navigateTo({
            url: `tabledetail2/tabledetail2?name=${name}`
        });
    },
    goto_communication(e) {
        let that = this
        let name = e.currentTarget.dataset.name
        wx.navigateTo({
            url: `communication_station/communication_station?name=${name}`
        });
    },
    gotogasdepot(e) {
        let that = this
        let name = e.currentTarget.dataset.name
        wx.navigateTo({
            url: `gasdepot/gasdepot?name=${name}`
        })
    },
    gotodatacenter(e) {
        let that = this
        let name = e.currentTarget.dataset.name
        wx.navigateTo({
            url: `datacenter/datacenter?name=${name}`
        })

    },
    gotogasstation(e) {
        let that = this
        let name = e.currentTarget.dataset.name
        wx.navigateTo({
            url: `gasstation/gasstation?name=${name}`
        })
    },
    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady: function() {

    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function() {

    },


    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide: function() {

    },

    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload: function() {

    },

    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh: function() {

    },

    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom: function() {

    },

    /**
     * 用户点击右上角分享
     */
    onShareAppMessage: function() {

    },



    /**   * 点击tab切换   */
    swichNav: function(e) {
        let _that = this
        let currentTab = e.currentTarget.dataset.current

        console.log(currentTab)
        _that.setData({
            currentTab
        })
    },
})